package com.trisan;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;




import java.io.*;



@Entity
@Table(name="EMP")
public class Emp implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	Integer id;
	String ename;
	String email;
	Integer salary;
	String deptid;
	
	
	public Emp(){
		System.out.println("emp obj created");
	}
	
/**	public Emp(Integer id,
				String ename,
				String email,
				Integer salary,
				String deptid){
		this.id=id;
		this.ename=ename;
		this.email=email;
		this.salary=salary;
		this.deptid=deptid;
	}*/
	
	@Id
	@Column(name="eno")
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	@Column(name="ename")
	public String getEname() {
		return ename;
	}
	public void setEname(String ename) {
		this.ename = ename;
	}
	
	@Column(name="email")	
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	
	@Column(name="salary")
	public Integer getSalary() {
		return salary;
	}
	public void setSalary(Integer salary) {
		this.salary = salary;
	}
	
	@Column(name="deptid")
	public String getDeptid() {
		return deptid;
	}
	public void setDeptid(String deptid) {
		this.deptid = deptid;
	}
	
	
/**
	@Override
	public void serialize(Emp e1, JsonGenerator arg1, SerializerProvider arg2)
			throws IOException, JsonProcessingException {
		// TODO Auto-generated method stub
		
		arg1.writeStartObject();
		arg1.writeFieldName("id");
		arg1.writeNumber(e1.id);
		arg1.writeFieldName("ename");
		arg1.writeString(e1.ename);
		arg1.writeFieldName("email");
		arg1.writeString(e1.email);
		arg1.writeFieldName("salary");
		arg1.writeNumber(e1.salary);
		arg1.writeFieldName("deptid");
		arg1.writeString(e1.deptid);
		arg1.writeFieldName("label");
		arg1.writeString(e1.ename);
		arg1.writeEndObject();
		
	}*/
	
}
